<% layout('/layout/default.html', {title: '树结构表生成详情', libs: ['validate', 'icheck']}){ %>
<div class="main-content">
	<div class="card-header">
		<i class="fa fa-sitemap"></i>${testTree.isNewRecord?'新增树结构表生成':'编辑树结构表生成'}
	</div>
	<#form:form id="inputForm" model="${testTree}" action="${ctx}/test/testTree/save" method="post" class="form-horizontal">
		<div class="card-body">
			<#form:hidden path="id"/>
			<div class="row">
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
					<div class="form-group row">
						<label class="col-form-label col-lg-4 col-md-4 text-right" title="">父级：</label>
						<div class="col-lg-8 col-md-8 ">
							<div class="form-control form-control-sm" readonly="readonly">
								<#form:hidden path="parent.id"/>
								<% if(isEmpty(testTree.parent.id)|| testTree.parent.id == "0") {%>
									根区域
								<% } else{ %>
									${testTree.parent.name}
								<% } %>
							</div>
						</div>
					</div>
				</div>
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
					<div class="form-group row">
						<label class="col-form-label col-lg-4 col-md-4 text-right" title="">
						 名称：
						</label>
						<div class="col-lg-8 col-md-8 ">
							<#form:input path="name"  maxlength="100" class="form-control form-control-sm "/>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
					<div class="form-group row">
						<label class="col-form-label col-lg-4 col-md-4 text-right" title="">
						 排序：
						</label>
						<div class="col-lg-8 col-md-8 ">
							<#form:input path="sort"  class="form-control form-control-sm digits"/>
						</div>
					</div>
				</div>
				<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
					<div class="form-group row">
						<label class="col-form-label col-lg-4 col-md-4 text-right" title="">
						 备注信息：
						</label>
						<div class="col-lg-8 col-md-8 ">
							<#form:textarea path="remarks" rows="4"  maxlength="255" class="form-control input-xxlarge "/>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="box-footer">
			<div class="row">
				<div class="offset-md-2 col-md-10">
					<% if (hasPermi('test:testTree:edit')){ %>
						<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> 保 存</button>
					<% } %>
					<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="window.parent.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> 关 闭</button>
				</div>
			</div>
		</div>
	</#form:form>
</div>
<% } %>

<script type="text/javascript">
	$("#inputForm").validate({
		submitHandler: function(form){
			js.ajaxSubmitForm($(form), function(data){
				js.showMessage(data.message);
				if(data.result == 'true'){
					window.parent.closeCurrentTabPage(window.parent.refreshTab);
				}
			});
	    }
	});
</script>